<?php
/**
 * User: Eric-Nothing
 * Datetime: 2019/6/24-9:40
 */
namespace App\Connector\Shape;

use App\Connector\ManageShapeInterface;

class Circle implements ShapeInterface,ManageShapeInterface
{
    public $radius;

    public function __construct($radius)
    {
        $this->radius = $radius;
    }

    //遵循开闭原则来计算面积
    public function area()
    {
        return pi() * pow($this->radius,2);
    }

    public function cal()
    {
        return $this->area();
    }
}